package com.justech.mes.utils;

import com.justech.mes.exception.BizException;

/**
 * @author feifei.li
 */
public class MesAssert {

    /**
     * 如果条件符合，将抛出异常
     *
     * @param expression 如果假设成立
     * @param msg
     */
    public static void isTrue(boolean expression, String msg) {
        if (expression) {
            throw new BizException(msg);
        }
    }

    public static void isException(boolean... expressions) {
        for (boolean bool : expressions) {
            isTrue(bool, "Inadequate provision of parameters [400]");
        }
    }

    public static void throwBizException(String msg) {
        throw new BizException(msg);
    }
}
